// src/api/user.js
import request, {postJson} from "@/apps/admin/utils/request.ts";
const server = "/v1/admin";
export function getUsers(page, size, search) {
    return request.get(server + `/getUsers?page=${page}&size=${size}&search=${search}`);
}

export const getNotReviewUsers = (page, size) => request.get(`${server}/getNotReviewUsers`, { params: { page, size } });

// // 获取分页用户
// export const getUsers = (page, size) => {
//     return axios.get(`/api/users?page=${page}&size=${size}`)
// }
export const createUser = (data) => {
    return postJson(server + `/createUser`, data)
}
export const updateUser = (data) => {
    return postJson(server + `/updateUser`, data)
}

// 审核通过接口
export const approveUserApi = (userId) => {
    return request.post(`${server}/approveReservationPermission`, {
        userId: userId
    })
}

// 审核拒绝接口
export const rejectUserApi = (userId) => {
    return request.post(`/${server}/rejectReservationPermission`,{
        userId: userId
    })
}
